<template>
    <commonTPage v-permission="'Yahee.ERP.TOOL.DingDingMessage'" v-if="renderDom">
        <navBar slot="navContent"  @putTableList='putTableList' ref="navBar"></navBar>
        <mainPageList slot="mainContent" :filterList='filterList'></mainPageList>
    </commonTPage>
</template>
<script>
import { hasPermissions } from '@/api/user.js'
import { addMask} from '@/utils/tools.js'
import { getAllTranslateList } from '@/utils/translate.js'
export default {
    name:'batchLogHandle',
    components:{
        commonTPage:() => import('@/components/common/commonTPage'),
        navBar:() => import('@/views/batchLogHandle/mainPage/navBar.vue'),
        mainPageList:() => import('@/views/batchLogHandle/mainPage/mainPageList.vue')
    },
    data(){
        return {
            filterList:{},
            renderDom:false,
        }
    },
    mounted(){
        this.getPermissions()
    },
    methods:{
        putTableList (val){
            this.filterList = val
        },
        getPermissions(){
            let  params = [
                'Yahee.ERP.TOOL.ProgramRelease'
            ]
            hasPermissions(params).then(res => {
                this.pageLoading = false
                let data = JSON.stringify( res.data);
                sessionStorage.setItem("permissions", data);
                this.renderDom = true
                let per = res.data.filter(item => {
                    return item.PermissionCode == 'Yahee.ERP.TOOL.ProgramRelease' && !item.HasPermission
                })
                if(per && per.length > 0){
                    addMask('Yahee.ERP.TOOL.ProgramRelease')
                }else {
                    getAllTranslateList(this)
                }
            })
        },
    }
}
</script>